home *** CD-ROM | disk | FTP | other *** search
/ Openstep 4.2 (Developer) / Openstep Developer 4.2.iso / NextDeveloper / OpenStepConversion / IntermediateFrameworks1 / AppKit.framework / Headers / tiff.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-11-15  |  2.3 KB  |  69 lines

  1. /*
  2.     tiff.h
  3.     Application Kit, Release 2.0
  4.     Copyright (c) 1988, 1989, 1990, NeXT, Inc.  All rights reserved. 
  5. */
  6. #import <streams/streams.h>
  7.  
  8. #define NX_PAGEHEIGHT 2048
  9.  
  10. #define NX_BIGENDIAN 0
  11. #define NX_LITTLEENDIAN 1
  12.  
  13. /* TIFF errors */
  14.  
  15. #define NX_BAD_TIFF_FORMAT 1
  16. #define NX_IMAGE_NOT_FOUND 2
  17. #define NX_ALLOC_ERROR 3
  18. #define NX_FORMAT_NOT_YET_SUPPORTED 4
  19. #define NX_FILE_IO_ERROR 5
  20. #define NX_COMPRESSION_NOT_YET_SUPPORTED 6
  21. #define NX_TIFF_CANT_APPEND 7
  22.  
  23. /* Compression values. */
  24.  
  25. #define NSTIFFCompressionNone    1
  26. #define NSTIFFCompressionCCITTFAX3    3    /* 1 bps only */
  27. #define NSTIFFCompressionCCITTFAX4    4    /* 1 bps only */
  28. #define NSTIFFCompressionLZW        5
  29. #define NSTIFFCompressionJPEG    6
  30. #define NSTIFFCompressionNEXT    32766    /* Input only */
  31. #define NSTIFFCompressionPackBits    32773
  32. #define NSTIFFCompressionOldJPEG    32865    /* Input only */
  33.  
  34. /*
  35.  * Structures used with the 1.0 TIFF read/write routines.
  36.  * 2.0 and 3.0 applications should use the NXBitmapImageRep class.
  37.  */
  38. typedef struct _NXImageInfo {
  39.     int width;             /* image width in pixels */
  40.     int height;            /* image height in pixels */
  41.     int bitsPerSample;     /* number of bits per data channel */
  42.     int samplesPerPixel;   /* number of channels per pixel */
  43.     int planarConfig;      /* NX_MESHED for mixed data channels */
  44.                        /* NX_PLANAR for separate data planes */
  45.     int photoInterp;       /* photometric interpretation of bitmap data, */
  46.                            /* formed by ORing the constants NX_ALPHAMASK, */
  47.                /* NX_COLORMASK, and NX_MONOTONICMASK.  */
  48. } NXImageInfo;
  49.  
  50. typedef struct _NXTIFFInfo {
  51.     int imageNumber;
  52.     NXImageInfo image;
  53.     int    subfileType;
  54.     int rowsPerStrip;
  55.     int stripsPerImage;
  56.     int compression;        /* compression id */
  57.     int numImages;        /* number of images in tiff */
  58.     int endian;            /* either NX_BIGENDIAN or NX_LITTLEENDIAN */
  59.     int version;        /* tiff version */
  60.     int error;
  61.     int firstIFD;        /* offset of first IFD entry */
  62.     unsigned int stripOffsets[NX_PAGEHEIGHT];
  63.     unsigned int stripByteCounts[NX_PAGEHEIGHT];
  64. } NXTIFFInfo;
  65.  
  66. extern int NSGetTIFFInfo(int imageNumber, NXStream *s, NXTIFFInfo *info);
  67. extern void *NSReadTIFF(int imageNumber, NXStream *s, NXTIFFInfo *info, void *data);
  68. extern void NSWriteTIFF(NXStream *s, NXImageInfo *image, void *data);
  69.